<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css" />
    <style>
        body {
            margin: 0
        }
        #header_top {
          background: #fff;
        }
        #header_top .aui-icon-left,
        #header_top .aui-title,
        #header_top .aui-icon-search,
        #header_top .aui-pull-right .aui-iconfont {
          color: #333;
        }
    </style>
</head>

<body>
  <header class="aui-bar aui-bar-nav" id="header_top">
    <a class="aui-pull-left aui-btn" onclick="goback()">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title"></div>
    <a class="aui-pull-right aui-btn aui-hide" onclick="click_tab()">
        编辑
    </a>
  </header>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/zepto.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript" src="../../script/swiper.min.js"></script>
<script type="text/javascript" src="../../script/aui-slide.js"></script>
<script type="text/javascript">
    function goback() {
        $api.setStorage('xxzf', 0);

      if(api.pageParam.type=='我的赠品'){
        api.closeToWin({
            name: 'root'
        });
      }else{
        api.closeWin()
      }
    }
    apiready = function () {
      var type = api.pageParam.type
      var name = api.pageParam.name
      var header_top = $api.byId('header_top');
  		var header_topPos = $api.offset(header_top);
      $('.aui-title').text(type)


      if(type=="我的足迹"){
        $('.aui-pull-right').removeClass('aui-hide')
      }else{
        $('.aui-pull-right').addClass('aui-hide')
      }
      if(api.pageParam.type=='提现规则' || api.pageParam.type=='商品售卖协议' || api.pageParam.type=='vip权益'||api.pageParam.type=="隐私协议"){
        api.openFrame({
          name: name,
          url: api.pageParam.data,
          rect: {
            x:0,
            y:header_topPos.h,
            w:'auto',
            h:api.frameHeight - header_topPos.h
          }

        })
      }else{
        api.openFrame({
          name: name,
          url: './'+name+'.html',
          rect: {
            x:0,
            y:header_topPos.h,
            w:'auto',
            h:api.frameHeight - header_topPos.h
          },
          pageParam: {
              name: type,
              code: api.pageParam.code || '',
              password: api.pageParam.password || '',
              data: api.pageParam.data || '',
              zh_type: api.pageParam.zh_type || ''
          }
        })
      }

    }


var k=0;
function click_tab(){
    k++;
    if(k%2!=0){
      $('.aui-pull-right').text('完成')
      api.execScript({
          frameName: 'myfooter',
          script: 'remove_hide();'
      });
    }else{
        $('.aui-pull-right').text('编辑')
      api.execScript({
          frameName: 'myfooter',
          script: 'add_hide();'
      });
    }
}
</script>

</html>
